<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="./jsp/resource/css/netca2.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="<%=basePath%>dwr/interface/UserServiceImpl.js"></script>
		<script src="getp10.js"></script>
	
		<script type="text/javascript">
		function getTypeAndSerial(){
		var obj;
		var caname ="广东省电子商务认证中心";
		try{
			obj = new ActiveXObject("NetcaBpmsClientCom.PKI");
			if(obj.IsInstalled(caname)){
				obj.SetCA(caname);
				if(obj.KeyCount>1){
					alert("只能插入1个key");
					return false;
				}
			
				document.getElementById("type").value=obj.Type;
				document.getElementById("serialnum").value=obj.SerialNumber;
				return true;
			}else{
				alert("不支持的ca!")
				return false;
			}
		}catch(e){
			alert(e.message);
			return false;
		}
	}
	
	</script>
	<title>证书制作</title>
	</head>
	<body>
		<form action="servlet/UpdateAndInstall" method="post"> 
			证书摘要：<input name="signcertdigest" id="signcertdigest"><br>
			有效期更新为：<input name="validity" id="validity" value=""><br>
			<input type="hidden" name="caname" id="caname" value="广东省电子商务认证中心">
			<input type="hidden" id="type" name="type">
			<input type="hidden" id="serialnum" name="serialnum">
			
			<input type="submit" id="updateCert" value="更新证书" onclick="return getTypeAndSerial()" >
		</form>
	</body>
</html>